<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.baoming.domain.Properties"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<table cellspacing="0" cellpadding="0" class="table-hover mailbox">
	<thead>
		<tr>
			<th>
				<div class="checker"><span><input type="checkbox" class="checkall"></span></div>
			</th>
			<th width="12%">
				属性值
			</th> 
			<th width="14%">
				说明
			</th> 
			<th width="18%">
				别名
			</th>
			<th width="14%">
				必须
			</th>
			<th width="14%">
				类型
			</th>
			<th width="14%">
				长度
			</th>
			<th width="14%">
				操作 
			</th>
		</tr>
	</thead>
	<tbody>
		
	 <c:forEach items="${props}" var="prop">
			<tr class="new">
				<td> 
					
					<c:choose>
						<c:when test="${empty prop.id}"> 
							<input type="checkbox" name="${prop.name }" value="${prop.name }" />
						</c:when>
						<c:otherwise>
							<input type="checkbox" name="${prop.name }" value="${prop.name }" checked="checked" />
						</c:otherwise>
					</c:choose>
					
				</td>
				<td>
					<a class="name">${prop.name }</a>
				</td>
				<td>
					<a class="subject">${prop.value }</a>
				</td>
				<td>
					<input type="text" name="${prop.name }_alias" value="${prop.alias }" placeholder="别名 ">
				</td> 
				<td>
					<c:choose>
						<c:when test="${prop.requested == 1}">
							<select name="${prop.name }_request">
								<option value="0">
									否
								</option>
								<option value="1" selected="selected">
									是
								</option>
							</select>
						</c:when>
						<c:otherwise>
							<select name="${prop.name }_request">
								<option value="0" selected="selected">
									否
								</option>
								<option value="1">
									是
								</option>
							</select>
						</c:otherwise>
					</c:choose>
					
				</td>
				<td>
					<c:choose>
						<c:when test="${prop.type == 'area' }">
							<select name="${prop.name }_type">
								<option value="area" selected="selected">
									区域
								</option>
								<option value="text">
									文本
								</option>
								<option value="file">
									相片
								</option>
							</select>
						</c:when>
						<c:when test="${prop.type == 'file'}">
							<select name="${prop.name }_type">
								<option value="area">
									区域
								</option>
								<option value="text">
									文本
								</option>
								<option value="file"  selected="selected">
									相片
								</option>
							</select>
						</c:when>
						<c:otherwise>
							<select name="${prop.name }_type">
								<option value="area">
									区域
								</option>
								<option value="text" selected="selected">
									文本
								</option>
								<option value="file">
									相片
								</option>
							</select>
						</c:otherwise>
					</c:choose>
					
				</td>
				<td> 
					<select name="${prop.name }_size">
						<c:forEach begin="3" end="10" varStatus="state"> 
							<c:choose>
								<c:when test="${(13-state.index) == prop.size}">
									<option value="${(13-state.index) }" selected="selected">
										${(13-state.index) }
									</option>
								</c:when>  
								<c:otherwise>
									   <option value="${(13-state.index) }">
												${(13-state.index) }
									    </option>  
								</c:otherwise>
							</c:choose>
							
						</c:forEach> 
					</select>  
				</td>
				
				<td>
					<c:choose>
						<c:when test="${empty prop.id}">  
							<a role="button" class="btn disabled" data-toggle="modal">添加值</a>
						</c:when>
						<c:otherwise>
							<c:choose>
								<c:when test="${prop.type == 'text' }">
								    <div class="span12">
										<a role="button" class="btn btn-primary" href="page/prop_valueEdit.action?id=${prop.id }" data-toggle="modal">添加值</a>
									</div>  
								</c:when>
								<c:otherwise> 
									<a role="button" class="btn disabled" data-toggle="modal">添加值</a> 
								</c:otherwise>
							</c:choose>
						</c:otherwise>
					</c:choose>
					
				</td>
			</tr>
		</c:forEach>
		
	</tbody>
</table>
 
